var screenHight, screenWidth, contentHeight;
//var jq = jQuery.noConflict();
$(function () {
	
	initWaterWorks();
	window.setInterval("reinitlframe()",200);	
})

function reinitlframe() {
	var iframe = document.getElementById("waterQualityIframe");
	//alert("ifrme"+iframe);
	try {
		var bHeight = iframe.contentWindow.document.body.scrollHeight;
		var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
		var height = Math.max(bHeight, dHeight);
		iframe.height = height;
		var rightHeight =height;
		//如果右边的内容超过了屏幕大小
		if (rightHeight > screenHight) {
			$("#leftContent").css({
				'height': rightHeight + 'px'
			});
		}
		else{
		$("#leftContent").css({
			'height': contentHeight + 'px'
		});
		}
	
	} catch (ex) {}
	//alert("iframe.height ="+iframe.height );

}

function initWaterWorks() {
	screenHight = $(window).height(); //浏览器当前窗口可视区域高度
	screenWidth = $(window).width(); //浏览器当前窗口可视区域宽度
	contentHeight = screenHight - 170;
	//window.frames[0].window.reinitlframe()

}

function loadExtentFile(filename, fileType) {
	if (fileType == "js") {
		var oJs = document.createElement('script');
		oJs.setAttribute("type", "text/javascript");
		oJs.setAttribute("src", filename); //文件的地址 ,可为绝对及相对路径
		document.getElementsByTagName("head")[0].appendChild(oJs); //绑定
	} else if (fileType == "css") {
		var oCss = document.createElement("link");
		oCss.setAttribute("rel", "stylesheet");
		oCss.setAttribute("type", "text/css");
		oCss.setAttribute("href", filename);
		document.getElementsByTagName("head")[0].appendChild(oCss); //绑定
	}
}